﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Common;

namespace Opponents
{
    public class Maniac: IPlayer
    {
        public double BankRoll { get; set; }
        public string PlayerID { get; set; }
        IDealer Dealer;
        public Maniac(IDealer dealer)
        {
            Dealer = dealer;
            PlayerID = G.OppPlayerID;
            dealer.DecisionPoint +=dealer_DecisionPoint;
        }

        private void dealer_DecisionPoint(object sender, DecisionEventArgs e)
        {
            if (e.PlayerID == PlayerID)
            {
                if (e.CurrentInfo.CanRaise)
                {
                    e.Decision = DecisionType.Raise;
                }
                else if (e.CurrentInfo.CanCall)
                {
                    e.Decision = DecisionType.Call;
                }
                else if (e.CurrentInfo.CanCheck)
                {
                    e.Decision = DecisionType.Check;
                }
                else
                {
                    e.Decision = DecisionType.Fold;
                }
            }
        }
    }
}
